/* 
* linux-3.0.8/drivers/net/gt2440_netdev.c
*/

#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/netdevice.h>


#include <asm/mach-types.h>
#include <asm/irq.h>
#include <mach/hardware.h>
#include <mach/regs-gpio.h>

#include "gt2440_net.h"


/***** platform resource *****/
static struct resource gt2440_net_resource[] = {
	[0] = {
		.start = GT2440_PA_NET,
		.end   = GT2440_PA_NET + SZ_1M - 1,
		.flags = IORESOURCE_MEM,
	},
	[1] = {
		.start = IRQ_EINT9,
		.end   = IRQ_EINT9,
		.flags = IORESOURCE_IRQ,
	}
};

/***** platform device *****/
static void gt2440_platform_device_release(struct device *dev){}
static struct platform_device gt2440_net_device = {
	.name = PLAT_DEVICE_NAME,
	.id = -1,
	.num_resources	  = ARRAY_SIZE(gt2440_net_resource),
	.resource	  = gt2440_net_resource,
	.dev		= {
		.release = gt2440_platform_device_release,
	},
};


static int __init gt2440_netdev_init(void)
{	dprintk("gt2440_netdev_init()\n");

	return platform_device_register(&gt2440_net_device);
}
static void __exit gt2440_netdev_exit(void)
{	dprintk("gt2440_netdev_exit()\n");

	platform_device_unregister(&gt2440_net_device);
}

module_init(gt2440_netdev_init);
module_exit(gt2440_netdev_exit);
MODULE_DESCRIPTION("GT2440 Net Device Register Driver");
MODULE_AUTHOR("Liguang13579<1659890447@qq.com>");
MODULE_LICENSE("GPL v2");


